cmake_minimum_required(VERSION 3.15)
project(Element-UI VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets Svg Xml REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui  Widgets Svg Xml REQUIRED)

aux_source_directory(src/Element-UI srcs)

file(GLOB_RECURSE QRC_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/res.qrc)

qt5_add_resources(QRC_FILES ${QRC_SOURCE_FILES})

add_executable(Element-UI ${srcs} ${QRC_FILES})

target_link_libraries(Element-UI Qt${QT_VERSION_MAJOR}::Core
                     Qt${QT_VERSION_MAJOR}::Gui
                     Qt${QT_VERSION_MAJOR}::Widgets
                     Qt${QT_VERSION_MAJOR}::Svg
                     Qt${QT_VERSION_MAJOR}::Xml
                    )